<template>
  <div id="submit-material-finance">
    <TopHeader/>
    <SubmitMaterialTop/>
    <!-- 财务数据（万元）-->
    <div class="submit-material-finance-list">
      <table border="1" class="submit-material-finance-list-one">
        <caption>
          财务数据（万元）<span style="font-size: 22px">（请提供上两年年度报表及近期报表）</span>
        </caption>
        <tbody>
        <tr>
          <th rowspan="2"><span>{{ yy }}年{{ mm }}月</span></th>
          <td>资产总额</td>
          <td>
            <el-input v-model="from.capitalInvestment2"/>
          </td>
          <td>负债总额</td>
          <td>
            <el-input v-model="from.totalLiabilities2"/>
          </td>
          <td>负债率</td>
          <td>
            <el-input v-model="from.debtRatio2"/>
          </td>
          <td>流动资产</td>
          <td>
            <el-input v-model="from.currentAssets2"/>
          </td>
          <td>销售收入</td>
          <td>
            <el-input v-model="from.salesRevenue2"/>
          </td>
          <td>利润总额</td>
        </tr>
        <tr>
          <td>固定资产</td>
          <td>
            <el-input v-model="from.fixedAssets2"/>
          </td>
          <td>流动负债</td>
          <td>
            <el-input v-model="from.currentLiabilities2"/>
          </td>
          <td>短期借款</td>
          <td>
            <el-input v-model="from.shortTermBorrowing2"/>
          </td>
          <td>长期借款</td>
          <td>
            <el-input v-model="from.longTermLoan2"/>
          </td>
          <td>销售成本</td>
          <td>
            <el-input v-model="from.sellingCost2"/>
          </td>
          <!--利润总额下面的输入框-->
          <td class="last-td">
            <el-input v-model="from.totalProfit2"/>
          </td>
        </tr>
        <tr>
          <th rowspan="2">{{ yy - 1 }}年</th>
          <td>资产总额</td>
          <td>
            <el-input v-model="from.capitalInvestment"/>
          </td>
          <td>负债总额</td>
          <td>
            <el-input v-model="from.totalLiabilities"/>
          </td>
          <td>负债率</td>
          <td>
            <el-input v-model="from.debtRatio"/>
          </td>
          <td>流动资产</td>
          <td>
            <el-input v-model="from.currentAssets"/>
          </td>
          <td>销售收入</td>
          <td>
            <el-input v-model="from.salesRevenue"/>
          </td>
          <td>利润总额</td>
        </tr>
        <tr>
          <td>固定资产</td>
          <td>
            <el-input v-model="from.fixedAssets"/>
          </td>
          <td>流动负债</td>
          <td>
            <el-input v-model="from.currentLiabilities"/>
          </td>
          <td>短期借款</td>
          <td>
            <el-input v-model="from.shortTermBorrowing"/>
          </td>
          <td>长期借款</td>
          <td>
            <el-input v-model="from.longTermLoan"/>
          </td>
          <td>销售成本</td>
          <td>
            <el-input v-model="from.sellingCost"/>
          </td>
          <td class="last-td">
            <el-input v-model="from.totalProfit"/>
          </td>
        </tr>
        <tr>
          <th rowspan="2">{{ yy - 2 }}年</th>
          <td>资产总额</td>
          <td>
            <el-input v-model="from.capitalInvestment1"/>
          </td>
          <td>负债总额</td>
          <td>
            <el-input v-model="from.totalLiabilities1"/>
          </td>
          <td>负债率</td>
          <td>
            <el-input v-model="from.debtRatio1"/>
          </td>
          <td>流动资产</td>
          <td>
            <el-input v-model="from.currentAssets1"/>
          </td>
          <td>销售收入</td>
          <td>
            <el-input v-model="from.salesRevenue1"/>
          </td>
          <td>利润总额</td>
        </tr>
        <tr>
          <td>固定资产</td>
          <td>
            <el-input v-model="from.fixedAssets1"/>
          </td>
          <td>流动负债</td>
          <td>
            <el-input v-model="from.currentLiabilities1"/>
          </td>
          <td>短期借款</td>
          <td>
            <el-input v-model="from.shortTermBorrowing1"/>
          </td>
          <td>长期借款</td>
          <td>
            <el-input v-model="from.longTermLoan1"/>
          </td>
          <td>销售成本</td>
          <td>
            <el-input v-model="from.sellingCost1"/>
          </td>
          <td class="last-td">
            <el-input v-model="from.totalProfit1"/>
          </td>
        </tr>
        </tbody>
        <colgroup>
          <col>
          <col>
          <col style="background-color: #fff;">
          <col>
          <col style="background-color: #fff;">
          <col>
          <col style="background-color: #fff;">
          <col>
          <col style="background-color: #fff;">
          <col>
          <col style="background-color: #fff;">
          <col>
        </colgroup>
      </table>
      <div class="submit-material-finance-list-divlast">
        <span style="margin-left: 20px">备注，若财务数据发生变化，注明原因</span>
      </div>
    </div>
    <!--第二个-->


    <div class="submit-material-finance-list">
      <table border="1" style="border:#c6c6c6 " class="submit-material-finance-list-one">
        <caption>
          现有贷款情况
        </caption>
        <tbody>
        <th>贷款银行</th>
        <th>金额（万元）</th>
        <th>贷款期限（年月日-年月日）</th>
        <th>利率（%）</th>
        <th>抵押方式（担保公司/直接抵押）</th>
        <tr v-for="(itme,index) in 3" :key="index">
          <td>
            <el-input v-model.number="input"/>
          </td>
          <td>
            <el-input v-model.number="input"/>
          </td>
          <td>
            <el-date-picker
                v-model="from.loansDate"
                type="daterange"
                start-placeholder="开始日期"
                end-placeholder="结束日期">
            </el-date-picker>
          </td>
          <td>
            <el-input v-model="input"/>
          </td>
          <td>
            <el-input v-model="input"/>
          </td>
        </tr>

        </tbody>
        <colgroup>
          <col span="5" style="background-color: #fff">
          <col>
          <col>
          <col>
          <col>
        </colgroup>
      </table>
      <div style="margin:20px;text-align: right">
        <el-button type="warning" @click="save">保存</el-button>
      </div>
    </div>
    <div style="text-align: center;width: 100%;margin-bottom: 30px">
      <button
          style="color: #ffffff; border:none;font-size: 20px;background-color: #5c96d7; width: 160px;border-radius:16px;height: 56px">
        打印
      </button>
      &nbsp;&nbsp;
      <button @click="submitForm(from)"
          style="color: #ffffff; border:none;font-size: 20px;background-color:#5c96d7;width: 160px;border-radius:16px;height: 56px">
        提交
      </button>
    </div>

  </div>
</template>

<script>
import TopHeader from "@/components/header/header";
import SubmitMaterialTop from "@/components/submit-material/submit-material-top";

export default {
  name: "submitMaterialFinance",
  components: {SubmitMaterialTop, TopHeader},
  data() {
    return {
      input: '',
      from: {
        capitalId: '', // 用户贷款序号

        yearMonth2: '', // 今年
        capitalInvestment2: '', // 今年资产总额
        totalLiabilities2: '', // 今年负债总额
        debtRatio2: '', // 今年负债率
        currentAssets2: '', // 今年流动资产
        salesRevenue2: '', // 今年销售收入
        fixedAssets2: '', // 今年固定资产
        currentLiabilities2: '', // 今年流动负债
        shortTermBorrowing2: '', // 今年短期借款
        longTermLoan2: '', // 今年长期借款
        sellingCost2: '', // 今年销售成本
        totalProfit2: '', // 今年利润总额

        year: '', // 前年
        capitalInvestment: '', // 前年资产总额
        totalLiabilities: '', // 前年负债总额
        debtRatio: '', // 前年负债率
        currentAssets: '', // 前年流动资产
        salesRevenue: '', // 前年销售收入
        fixedAssets: '', // 前年固定资产
        currentLiabilities: '', // 前年流动负债
        shortTermBorrowing: '', // 前年短期借款
        longTermLoan: '', // 前年长期借款
        sellingCost: '', // 前年销售成本
        totalProfit: '', // 前年利润总额

        yearMonth1: '', // 往年
        capitalInvestment1: '', // 往年资产总额
        totalLiabilities1: '', // 往年负债总额
        debtRatio1: '', // 往年负债率
        currentAssets1: '', // 往年流动资产
        salesRevenue1: '', // 往年销售收入
        fixedAssets1: '', // 往年固定资产
        currentLiabilities1: '', // 往年流动负债
        shortTermBorrowing1: '', // 往年短期借款
        longTermLoan1: '', // 往年长期借款
        sellingCost1: '', // 往年销售成本
        totalProfit1: '', // 往年利润总额

        // 现有贷款情况

        lending: '', // 贷款银行
        moeny: '', // 金额
        loansDate: '', // 贷款日期
        lengthOfMaturity: '', // 贷款期限
        rateOfInterest: '', // 利率
        meansOfMortgage: '', // 抵押方式
      }
    }
  },
  methods: {
    /*
    *   获取年月
    * */
    getNowDate() {
      let yy = new Date().getFullYear(); // 获取年份
      let mm = new Date().getMonth() + 1; // 获取月份
      this.mm = mm
      this.yy = yy
      this.yearMonth2 = yy + '' + mm // 今年
      this.year = (yy - 1) // 前年
      this.yearMonth1 = (yy - 2) // 往年
    },
    /*
    * 点击保存, 数据暂存
    * */
    save() {
      console.log('数据暂存', this)
    },
    submitForm(from){
      this.$router.push('/home/application-information/application-information')
    }
  },
  created() {
    this.getNowDate()
  },
  mounted() {
    //实例挂载完毕前 // 页面水印效果
    this.watermark.set("张万志")
  },
}
</script>

<style src="./submit-material-finance.css" scoped>

</style>
